package com.zhouheng.common.base.web;

import com.zhouheng.common.base.BaseCode;
import lombok.AllArgsConstructor;


@AllArgsConstructor
public enum WebCode implements BaseCode {
    // 900以下， Http状态码相关
    SUCCESS(200, "成功"),
    BAD_REQUEST(400, "错误的请求"),
    UNAUTHORIZED(401, "无权限访问"),
    FORBIDDEN(403, "认证异常"),
    NOT_FOUND(404, "找不到对应请求"),
    METHOD_NOT_ALLOWED(405, "不支持的请求方法"),
    UNSUPPORTED_MEDIA_TYPE(415, "不支持当前媒体类型"),
    ERROR(500, "系统繁忙"),

    FEIGN_CALL_ERROR(517, "服务间调用出错"),
    // 900以上， 通用错误码
    AUTH_FAILED(900, "认证失败"),
    ARG_INVALID(901, "参数错误");


    private final int code;

    private final String msg;

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

}
